/****************************************************************************
	This file is part of Basqet.

	Basqet is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	Basqet is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
    along with Basqet.  If not, see <http://www.gnu.org/licenses/>.

****************************************************************************/

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "uicapabilities.h"
#include "richtextbroker.h"
#include "noteobjectbroker.h"

#include <QtGui/QMainWindow>
#include <QPointer>
#include <QFileInfo>

#include "ui_mainwindow.h"


class BasketManager;
class RichTextEditToolBar;
class NoteObjectToolBar;
class EditSettingsDialog;
class AboutDialog;

class QSystemTrayIcon;
class QFileSystemModel;

class MainWindow : public QMainWindow
{
    Q_OBJECT

	public:
		MainWindow(QWidget *parent = 0);
		~MainWindow();

	public slots:
		void activated(QObject*,UICapabilities capabilities);
		void deActivated(QObject*,UICapabilities capabilities);

		void showSettingsDialog();
		void showAboutDialog();
		void showAboutQtDialog();


	protected slots:
		void LoadBasket(QFileInfo newPath);

		void basketAboutToChange();
		void basketIsChanged();

		void actionExport();

		void trayIconClicked();

		void aboutToQuit();

	private:
		void setupApplication();
		void startBackupThread();

	private:
		Ui::MainWindow					ui;

		QPointer<QSystemTrayIcon>		mSystemtrayIcon;
		QPointer<EditSettingsDialog>	mSettingsDialog;
		QPointer<AboutDialog>			mAboutDialog;

		QPointer<BasketManager>			mCurrentBasket;


		QPointer<RichTextEditToolBar>	mRichTextEditorToolbar;
		QPointer<NoteObjectToolBar>		mNoteObjectToolbar;

		RichTextBroker					mRichTextBroker;
		NoteObjectBroker				mNoteObjectBroker;




};

#endif // MAINWINDOW_H
